﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class account_EditPersonalInfo : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack == false)
        {
            addressTextBox.Text = Profile.Address;
            phoneTextBox.Text = Profile.Phone;
            creditCardTextBox.Text = Profile.CreditCardNumber;
            capitalLabel.Text = Profile.Capital.ToString();
        }
    }
    protected void submitButton_Click(object sender, EventArgs e)
    {
        Profile.Address = addressTextBox.Text;
        Profile.Phone = phoneTextBox.Text;
        Profile.CreditCardNumber = creditCardTextBox.Text;

        actionMessageLabel.Text = "Editing successed.";
        actionMessageLabel.Visible = true;
    }

    protected void creditCardTextBox_TextChanged(object sender, EventArgs e)
    {
        Profile.Capital= new Random().Next(100, 30000);
    }
}